package com.ymatou.app.api.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.app.api.parameter.SimilarProdBean;
import com.ymatou.app.api.service.SimilarProdCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.tag.P1;

public class Ts_SimilarProd {
	
	private static SimilarProdBean similarProdBean;
	private static SimilarProdCall similarProdCall;
	
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("根据商品id获得相似商品");
	}
	
	@Before
	public void caseUp() {
		similarProdBean = new SimilarProdBean();
		similarProdCall = new SimilarProdCall();
	}
	
	@AfterClass
	public static void tearDown() {
		Logger.generateResult(similarProdCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_SimilarProd_001() {
		Logger.start(true,"获取相似商品成功");
		try {
			similarProdBean.setProductId("ef7ac28b-7c03-4168-b5b8-49bf8d062118");
			similarProdBean.setPageNumber("1");
			similarProdBean.setPageSize("10");
			
			similarProdCall.setData(similarProdBean);
			similarProdCall.callService();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}
